package com.car.account.util.validatorUtil;

/**
 * 验证手机号格式
 */
public class PhoneNumberValidator {

    private static final String PHONE_NUMBER_PATTERN = "^1(3[0-9]|4[579]|5[^4D]\\d|66|7[0135678]|8[0-9]|9[089])\\d{8}$";

    public static boolean isValidPhoneNumber(String phoneNumber) {
        return phoneNumber.matches(PHONE_NUMBER_PATTERN);
    }

    public static void main(String[] args) {
        String phoneNumber = "";
        System.out.println("Phone number is valid: " + isValidPhoneNumber(phoneNumber));
    }
}
